var limsPreFolder = Gikam.getPageObject({

    getEditListColumns : function() {
        return [ {
            checkbox : true
        }, {index: true},{
            field : 'type',
            title : 'T_LIMS_PRE_FOLDER.TYPE',
            type : 'select',
            category : 'sys',
            param : {
                codeCategoryId_EQ : 'preFolderType'
            },
            styleFormatter: function (row) {
                if (row.type === 'H') {
                    return {backgroundColor: '#f8d809'}
                } else if (row.type === 'M') {
                    return {backgroundColor: '#0998f8'}
                }
                return null;
            },
            width : 120
        }, {
            field : 'batchCode',
            title : 'T_LIMS_PRE_FOLDER.BATCHCODE',
            type : 'link',
            width : 120
        }, {
            field : 'sampleCode',
            title : 'T_LIMS_PRE_FOLDER.SAMPLECODE',
            width: 160,
        }, {
            field : 'sampleTypeName',
            title : 'T_LIMS_PRE_FOLDER.SAMPLETYPENAME',
        }, {
            field : 'productCode',
            title : 'T_LIMS_PRODUCT_MAIN.PRODUCTCODE'
        }, {
            field : 'productName',
            title : 'T_LIMS_PRODUCT_MAIN.PRODUCTNAME',
            width : 140
        }, {
            field : 'etCode',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE.ETCODE',
            type: 'choose',
            editor : true,
            validators: ['notEmpty'],
            category: 'product-template-choose',
            single: true,
            onBeforeChoose: function () {
                let row = this.getActivedRow();
                // if (Gikam.isEmpty(row.sampleTypeName)) {
                //     return false;
                // }
                return {
                    productMainId_EQ: row.productId,
                    sampleTypeName_EQ: row.sampleTypeName
                }
            },
            onAfterChoose: function (rows, index) {
                if (Gikam.isNotEmpty(rows)) {
                    this.setData({
                        index: index,
                        productEtId: rows[0].id,
                        etId: rows[0].etId,
                        etCode: rows[0].etCode
                    })
                }
            },
            width : 120
        }, {
            field : 'ext$.selectetcode',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE.ETNAME',
            type : 'select',
            category : 'experimentalTemplate',
            width : 120
        }, /*{
            field : 'ext$.judgcode',
            title : 'T_LIMS_JUDGMENT_BASIS.JUDGNAME',
            type : 'select',
            category : 'judgment',
        }, */{
            field : 'experimentNo',
            title : 'T_LIMS_PRE_FOLDER.EXPERIMENTNO',
            // validators: ['notEmpty'],
            editor : true,
        }, /*{
            field : 'remark',
            title : 'T_LIMS_PRE_FOLDER.REMARK',
            editor : true,
        },*/{
            field: 'ext$.locationdesc',
            title: 'T_LIMS_SAMPLE.LOCATIONS2',// 存放位置
            width: 140,
        }, {
            field: 'ext$.locations',
            title: 'T_LIMS_SAMPLE.LOCATIONS',
        } ];
    },

    getBaseInfoFormFields : function() {
        return [ {
            field : 'batchCode',
            title : 'T_LIMS_PRE_FOLDER.BATCHCODE',
            validators : [ 'strLength[0,11]' ]
        }, {
            field : 'sampleCode',
            title : 'T_LIMS_PRE_FOLDER.SAMPLECODE',
            validators : [ 'strLength[0,11]' ]
        }, {
            field : 'sampleTypeCode',
            title : 'T_LIMS_PRE_FOLDER.SAMPLETYPECODE',
            validators : [ 'strLength[0,11]' ]
        }, {
            field : 'sampleTypeName',
            title : 'T_LIMS_PRE_FOLDER.SAMPLETYPENAME',
            validators : [ 'strLength[0,11]' ]
        }, {
            field : 'productCode',
            title : 'T_LIMS_PRODUCT_MAIN.PRODUCTCODE',
            validators : [ 'strLength[0,11]' ]
        }, {
            field : 'productName',
            title : 'T_LIMS_PRODUCT_MAIN.PRODUCTNAME',
            validators : [ 'strLength[0,22]' ]
        }, {
            field : 'etCode',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE.ETCODE',
            validators : [ 'strLength[0,11]' ]
        }, {
            field : 'type',
            title : 'T_LIMS_PRE_FOLDER.TYPE',
            validators : [ 'strLength[0,11]' ]
        }, {
            field : 'status',
            title : 'T_LIMS_PRE_FOLDER.STATUS',
            validators : [ 'strLength[0,11]' ]
        }, {
            field : 'experimentNo',
            title : 'T_LIMS_PRE_FOLDER.EXPERIMENTNO',
            validators : [ 'strLength[0,11]' ]
        }, {
            field : 'operationBatch',
            title : 'T_LIMS_PRE_FOLDER.OPERATIONBATCH',
            validators : [ 'strLength[0,11]' ]
        }, {
            field : 'remark',
            title : 'T_LIMS_PRE_FOLDER.REMARK',
            validators : [ 'strLength[0,22]' ]
        }, ];
    },

    getChooseListColumns : function() {
        return [{index: true}, {
            field : 'type',
            title : 'T_LIMS_PRE_FOLDER.TYPE',
            type : 'select',
            category : 'sys',
            param : {
                codeCategoryId_EQ : 'preFolderType'
            },
            styleFormatter: function (row) {
                if (row.type === 'H') {
                    return {backgroundColor: '#f8d809'}
                } else if (row.type === 'M') {
                    return {backgroundColor: '#0998f8'}
                }
                return null;
            },
            width : 120
        }, {
            field : 'batchCode',
            title : 'T_LIMS_PRE_FOLDER.BATCHCODE'
        }, {
            field : 'sampleCode',
            title : 'T_LIMS_PRE_FOLDER.SAMPLECODE'
        }, {
            field : 'sampleTypeCode',
            title : 'T_LIMS_PRE_FOLDER.SAMPLETYPECODE'
        }, {
            field : 'sampleTypeName',
            title : 'T_LIMS_PRE_FOLDER.SAMPLETYPENAME'
        }, {
            field : 'productCode',
            title : 'T_LIMS_PRODUCT_MAIN.PRODUCTCODE'
        }, {
            field : 'productName',
            title : 'T_LIMS_PRODUCT_MAIN.PRODUCTNAME'
        }, {
            field : 'etCode',
            title : 'T_LIMS_PRE_FOLDER.ETCODE'
        }, {
            field : 'type',
            title : 'T_LIMS_PRE_FOLDER.TYPE'
        }, {
            field : 'experimentNo',
            title : 'T_LIMS_PRE_FOLDER.EXPERIMENTNO'
        }, {
            field : 'operationBatch',
            title : 'T_LIMS_PRE_FOLDER.OPERATIONBATCH'
        }, {
            field : 'remark',
            title : 'T_LIMS_PRE_FOLDER.REMARK'
        }, ];
    },

    getHisTaskChooseListColumns : function() {
        return [ {
            field : 'operationBatch',
            title : 'T_LIMS_PRE_FOLDER.OPERATIONBATCH'
        }, {
            field : 'batchCode',
            title : 'T_LIMS_PRE_FOLDER.BATCHCODE'
        }, {
            field : 'sampleCode',
            title : 'T_LIMS_PRE_FOLDER.SAMPLECODE',
            width: 160,
        }, {
            field : 'sampleTypeName',
            title : 'T_LIMS_PRE_FOLDER.SAMPLETYPENAME'
        }, /*{
            field : 'productCode',
            title : 'T_LIMS_PRODUCT_MAIN.PRODUCTCODE'
        },*/ {
            field : 'productName',
            title : 'T_LIMS_PRODUCT_MAIN.PRODUCTNAME'
        },/* {
            field : 'etCode',
            title : 'T_LIMS_PRE_FOLDER.ETCODE'
        }, {
            field : 'etName',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE.ETNAME',
            // type : 'select',
            // category : 'experimentalTemplate',
            width : 120
        },*/ /*{
            field : 'remark',
            title : 'T_LIMS_PRE_FOLDER.REMARK'
        },*/ {
            field : 'ext$.orino',
            title : 'T_LIMS_SAMPLE.ORINO'
        },];
    },

    getOperationBatchColumns: function() {
        return [ {
            checkbox : true
        },{index: true}, {
            field : 'operationBatch',
            title : 'T_LIMS_OPERATION_BATCH.OPERATIONBATCH'
        }, {
            field : 'etCode',
            title : 'T_LIMS_EXPERIMENTAL_TEMPLATE.ETNAME',
            type : 'select',
            category : 'experimentalTemplate',
        }, /*{
            field : 'batchOrgId',
            title : 'T_LIMS_OPERATION_BATCH.BATCHORG',
            type: 'select',
            category: 'org'
        }, */{
            field : 'createdByName',
            title : 'T_LIMS_OPERATION_BATCH.CREATEDBYNAME',
        }, {
            field : 'createdTime',
            title : 'T_LIMS_OPERATION_BATCH.CREATEDTIME',
            width: 150
        } ];
    },

    getPreTaskSupplementColumns: function() {
        return [ {
            checkbox : true
        },{index: true}, {
            field : 'type',
            title : 'T_LIMS_PRE_FOLDER.TYPE',
            type : 'select',
            category : 'sys',
            param : {
                codeCategoryId_EQ : 'preFolderType'
            },
            width : 120
        }, {
            field : 'batchCode',
            title : 'T_LIMS_PRE_FOLDER.BATCHCODE',
            width : 120
        }, {
            field : 'sampleCode',
            title : 'T_LIMS_PRE_FOLDER.SAMPLECODE',
            width : 120
        }, {
            field : 'sampleTypeName',
            title : 'T_LIMS_PRE_FOLDER.SAMPLETYPENAME',
        }, {
            field : 'productCode',
            title : 'T_LIMS_PRODUCT_MAIN.PRODUCTCODE'
        }, {
            field : 'productName',
            title : 'T_LIMS_PRODUCT_MAIN.PRODUCTNAME',
            width : 140
        }, /*{
            field : 'ext$.judgcode',
            title : 'T_LIMS_JUDGMENT_BASIS.JUDGNAME',
            type : 'select',
            category : 'judgment',
        }, */{
            field : 'experimentNo',
            title : 'T_LIMS_PRE_FOLDER.EXPERIMENTNO',
            editor : true,
        }, /*{
            field : 'remark',
            title : 'T_LIMS_PRE_FOLDER.REMARK',
        }, */{
            field: 'ext$.locations',
            title: 'T_LIMS_SAMPLE.LOCATIONS',
        } ];
    },

    getMixChooseListColumns : function() {
        return [{index: true},{
            field : 'derivativeNo',
            title : 'T_LIMS_SAMPLE_DERIVATIVE.DERIVATIVENO'
        }, {
            field : 'parentNo',
            title : 'T_LIMS_SAMPLE_DERIVATIVE.PARENTNO'
        }, {
            field : 'ext$.sampletype',
            title : 'T_LIMS_SAMPLE.SAMPLETYPE'
        }, {
            field : 'createdTime',
            title : 'T_LIMS_SAMPLE_DERIVATIVE.CREATEDTIME',
            type : 'dateTime',
        }];
    },

    getAllDerivativeEditListColumns : function() {
        return [ {
            radio : true
        },{index: true}, {
            field : 'derivativeNo',
            title : 'T_LIMS_SAMPLE.SAMPLECODE',
        }, {
            field : 'parentNo',
            title : 'T_LIMS_SAMPLE.PARENTNO',
        }, {
            field : 'oriNo',
            title : 'T_LIMS_SAMPLE.ORINO',
        }, {
            field : 'ext$.sampletype',
            title : "T_LIMS_SAMPLE.SAMPLETYPE",
        }, {
            field : 'derivativeType',
            title : 'T_LIMS_SAMPLE_DERIVATIVE.DERIVATIVETYPE',
            type : "select",
            category : 'sys',
            firstBlank : false,
            param : {
                codeCategoryId : 'derivativeMakeType'
            },
        }, {
            field : 'useFlag',
            title : 'GIKAM.ACTIVE.TITLE.STATUS',
            type : "simpleCheckbox",
        } ]
    },

    baseUrl : IFM_CONTEXT + '/secure/basemodule/business/pre-folders',
    batchUrl: IFM_CONTEXT + '/secure/basemodule/business/batchs',
    operationBatchUrl: IFM_CONTEXT + '/secure/basemodule/business/operation-batchs',
    preTaskSupplementUrl: IFM_CONTEXT + '/secure/basemodule/business/pre-task-supplements',
    derivativelUrl : IFM_CONTEXT + '/secure/baseline/samplemanage/sample-derivatives',
});
